Imports System.Web.HttpContext


Namespace Workflow


    Public Class CSession

        'Login Info
        Public Shared ReadOnly Property User As CUser
            Get
                Return CUser.Cache.GetById(Current.User.Identity.Name)
            End Get
        End Property

        'sticky settings - ListItems page
        Public Shared Property UserId() As Integer
            Get
                Dim s As String = Current.Session("UserId")
                If IsNothing(s) Then Current.Session("UserId") = Current.User.Identity.Name
                Return Current.Session("UserId")
            End Get
            Set(ByVal Value As Integer)
                Current.Session("UserId") = Value
            End Set
        End Property
        Public Shared Property CategoryId() As Integer
            Get
                Return Current.Session("CategoryId")
            End Get
            Set(ByVal Value As Integer)
                Current.Session("CategoryId") = Value
            End Set
        End Property
        Public Shared Property Status() As Integer
            Get
                Return Current.Session("Status")
            End Get
            Set(ByVal Value As Integer)
                Current.Session("Status") = Value
            End Set
        End Property

        'Sticky settings - edit page
        Public Shared Property LastPriority() As Integer
            Get
                Return Current.Session("LastPriority")
            End Get
            Set(ByVal Value As Integer)
                Current.Session("LastPriority") = Value
            End Set
        End Property
        Public Shared Property LastCategoryId() As Integer
            Get
                Return Current.Session("LastCategoryId")
            End Get
            Set(ByVal Value As Integer)
                Current.Session("LastCategoryId") = Value
            End Set
        End Property

    End Class

End Namespace
